efficient technique to find missing number in an array